(import com.softhinker.ke24.unit3.model.*)

(deftemplate GreedLevel (declare (from-class GreedLevel)))
(deftemplate Affordability (declare (from-class Affordability)))
(deftemplate ProfessionLevel (declare (from-class ProfessionLevel)))
(deftemplate Stock (declare (from-class Stock)))

(defrule less-greedy
    (GreedLevel {value <= 3})
    =>
    (printout t "less-greedy" crlf)
    (add (new Stock "C31"))
    (add (new Stock "D05"))
    (add (new Stock "B2F"))
    (add (new Stock "P19"))
    (add (new Stock "NR7"))
    (add (new Stock "C6L"))
    (add (new Stock "Z74"))
    (add (new Stock "CC3"))
)

(defrule moderate-greedy
    (GreedLevel {value > 3 && value <= 6})
    =>
    (printout t "moderate-greedy" crlf)
    (add (new Stock "E8Q"))
    (add (new Stock "B20"))
    (add (new Stock "AW9U"))
    (add (new Stock "588"))
    (add (new Stock "Q0W"))
    (add (new Stock "5TI"))
    (add (new Stock "547"))
    (add (new Stock "O02"))
    (add (new Stock "QC7"))
    (add (new Stock "B49"))
    (add (new Stock "MN5"))
)

(defrule super-greedy
    (GreedLevel {value > 6})
    =>
    (printout t "super-greedy" crlf)
    (add (new Stock "5DE"))
    (add (new Stock "Y07"))
    (add (new Stock "581"))
    (add (new Stock "E9A"))
    (add (new Stock "PA3"))
    (add (new Stock "A6F"))
    (add (new Stock "547"))
    (add (new Stock "5BA"))
    (add (new Stock "MC7"))
    (add (new Stock "I9T"))
)

(defrule weak-affordability
    (Affordability {value > 1 && value <= 3})
    =>
    (printout t "weak-affordability" crlf)
    (add (new Stock "E8Q"))
    (add (new Stock "C31"))
    (add (new Stock "D05"))
    (add (new Stock "B2F"))
    (add (new Stock "NR7"))
    (add (new Stock "C6L"))
    (add (new Stock "Z74"))
)

(defrule moderate-affordability
    (Affordability {value > 3 && value <= 6})
    =>
    (printout t "moderate-affordability" crlf)
    (add (new Stock "B20"))
    (add (new Stock "AW9U"))
    (add (new Stock "588"))
    (add (new Stock "581"))
    (add (new Stock "5TI"))
    (add (new Stock "547"))
    (add (new Stock "P19"))
    (add (new Stock "QC7"))
    (add (new Stock "CC3"))
    (add (new Stock "A6F"))
    (add (new Stock "B49"))
    (add (new Stock "MC7"))
)

(defrule strong-affordability
    (Affordability {value > 6 && value <= 10})
    =>
    (printout t "strong-affordability" crlf)
    (add (new Stock "5DE"))
    (add (new Stock "Q0W"))
    (add (new Stock "E9A"))
    (add (new Stock "O02"))
    (add (new Stock "PA3"))
    (add (new Stock "5BA"))
    (add (new Stock "MN5"))
    (add (new Stock "I9T"))
    (add (new Stock "CC3"))
    (add (new Stock "A6F"))
    (add (new Stock "B49"))
    (add (new Stock "MC7"))
)

(defrule less-professional
    (ProfessionLevel {value <= 2})
    =>
    (printout t "less-professional" crlf)
    (add (new Stock "B2F"))
    (add (new Stock "QC7"))
    (add (new Stock "NR7"))
    (add (new Stock "C6L"))
    (add (new Stock "Z74"))
    (add (new Stock "CC3"))
)

(defrule moderate-professional
    (ProfessionLevel {value > 2 && value <= 4})
    =>
    (printout t "moderate-professional" crlf)
    (add (new Stock "E8Q"))
    (add (new Stock "B20"))
    (add (new Stock "AW9U"))
    (add (new Stock "581"))
    (add (new Stock "Q0W"))
    (add (new Stock "5TI"))
    (add (new Stock "547"))
    (add (new Stock "O02"))
    (add (new Stock "P19"))
    (add (new Stock "B49"))
)

(defrule very-professional
    (ProfessionLevel {value == 5})
    =>
    (printout t "very-professional" crlf)
    (add (new Stock "5DE"))
    (add (new Stock "Y07"))
    (add (new Stock "588"))
    (add (new Stock "E9A"))
    (add (new Stock "PA3"))
    (add (new Stock "A6F"))
    (add (new Stock "5BA"))
    (add (new Stock "MN5"))
    (add (new Stock "MC7"))
    (add (new Stock "I9T"))
)